<?php 
	require_once("controller/login_controller.php");
	require_once("controller/lupa_password_controller.php");
	require_once("controller/member_controller.php");
	require_once("controller/testimoni_controller.php");
	require_once("controller/contactus_controller.php");
	require_once("controller/news_controller.php");
	
	if((isset($_POST['username']) and isset($_POST['password'])) or isset($_GET['logout'])) {
		$logincontroller = new LoginController();
		$logincontroller -> invoke ();
	} else if (isset($_POST['id_user']) and isset($_POST['id_userkat']) and isset($_POST['password']) and isset($_POST['namadepan'])
			and isset($_POST['namabelakang']) and isset($_POST['alamatuser']) and isset($_POST['notelpuser']) and isset($_POST['kotauser'])
			and isset($_POST['emailuser']) and isset($_POST['kodeposuser']) and isset($_POST['fotouser']) and isset($_GET['edit_member'])){
		$membercontroller = new MemberController ();
		$membercontroller -> invoke();
	} else if (isset($_POST['id_user']) and isset($_POST['id_userkat']) and isset($_POST['password']) and isset($_POST['namadepan'])
			and isset($_POST['namabelakang']) and isset($_POST['alamatuser']) and isset($_POST['notelpuser']) and isset($_POST['kotauser'])
			and isset($_POST['emailuser']) and isset($_POST['kodeposuser']) and isset($_POST['fotouser'])){
		$membercontroller = new MemberController ();
		$membercontroller -> invoke();
	} elseif ((isset($_GET['member']))){
		$membercontroller = new MemberController();
		$membercontroller -> invoke(); 	
	} elseif ((isset($_GET['contactus']))){
		$contactuscontroller = new ContactUsController();
		$contactuscontroller -> invoke(); 	
	} elseif ((isset($_GET['news']))){
		$newscontroller = new NewsController();
		$newscontroller -> invoke();	
	} elseif ((isset($_GET['testimoni']))){
		$testimonicontroller = new TestimoniController();
		$testimonicontroller -> invoke(); 	
	} elseif ((isset($_POST['username']) and isset($_POST['emailuser']))) {
		$lupapasswordcontroller = new LupaPasswordController();
		$lupapasswordcontroller -> invoke ();
	} else {
		header("Location:view/home.php");
	}
?>